Skip to content

release: v0.2.2 - #143

Merged
fedorovvvv merged 10 commits into
mainfrom
release/v0.2.2
May 9, 2026
Merged

fedorovvvv merged 10 commits into
mainfrom
release/v0.2.2

Conversation

@fedorovvvv

Copy link
Copy Markdown
Collaborator

Summary

  • feat(health-bar): instance switcher rebuilt — Popover → Dialog, skeleton loading, live status + validation, refresh on open
  • fix(button): center SVG icons in flex layout

Why

Patch release: accumulates health-bar instance switcher improvements shipped on develop since v0.2.1.

Test plan

  • CI matrix (ubuntu / macos / windows) green
  • npm run smoke passes post-merge
  • Instance switcher opens as Dialog, shows skeleton on load, refreshes on re-open

Refs: release/v0.2.2

🤖 Generated with Claude Code

fedorovvvv and others added 10 commits May 9, 2026 18:54
## Summary

Back-merge of `release/v0.2.1` into `develop` so the version bump
(`0.2.0 → 0.2.1`) and CHANGELOG entry don't get lost.

## Why

Standard GitFlow back-merge step after cutting a release. Brings only
the `chore(release): bump version to 0.2.1` commit — no feature changes.

## Test plan

- [ ] No conflicts (develop already has all fix commits)
- [ ] Merge with `--merge`

🤖 Generated with [Claude Code](https://claude.com/claude-code)
SVG icons from @lucide/svelte now display with proper vertical centering
in buttons by applying flex layout to SVG elements. Fixes misaligned
icons in buttons with inline content.
## Summary
Fix vertical centering of SVG icons in buttons by setting `display:
block` on SVG elements within buttons.

## Why
SVG elements rendered as inline or inline-flex don't participate
correctly in the parent button's flexbox vertical centering
(align-items: center). Setting `display: block` allows SVG elements to
respect the parent's centering alignment.

## Test plan
- Visual inspection of buttons with icons on `/playground` confirms
icons are perfectly centered
- DOM inspection verified centeringDelta: 0 (mathematically perfect
centering)
- All button variants (primary, secondary, ghost, ghost-mono) with icons
are centered correctly
…on, refresh on open

Implements issue #134:
- Refresh instances list each time the popover opens (instancePoller.refresh())
- Poll /api/instance-status on every other instance every 10 s; show
  agent count + artifact total alongside each switcher item; show "offline"
  when the probe fails
- Validate connection via fetch to target /api/instance-status before switching;
  show a sonner error toast on failure instead of navigating blind
- Filter the current instance out of the command list; update empty-state copy
- Disable command items while a switch is in flight (switching guard)
- New GET /api/instance-status endpoint: runs forgeplan health + claims --json
  in parallel, returns { health, agentCount }; uses only allowed subcommands
- New InstanceStatus / InstanceHealth types in entities/instance

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…on, refresh on open (#136)

## Summary

- **Refresh on open** — calls `instancePoller.refresh()` every time the
popover opens so the list is always current
- **Live status polling** — polls `GET /api/instance-status` on each
other instance every 10 s; shows agent count + artifact total in each
switcher row; shows `offline` badge when the probe fails
- **Pre-flight validation** — before navigating to a selected instance,
fetches its `/api/instance-status`; if unreachable, fires a sonner error
toast and aborts the switch
- **Filter current instance** — current instance is excluded from the
command list; updated empty-state copy ("No other instances are
running")
- **Switch guard** — `switching` flag disables command items while a
validation fetch is in flight (prevents double-clicks)
- **New endpoint** `GET /api/instance-status` — runs `forgeplan health
--json` + `forgeplan claims --json` in parallel, returns `{ health,
agentCount }`; uses only subcommands already in `READ_ONLY_SUBCOMMANDS`
(rule 22 compliant)
- **New types** `InstanceStatus` / `InstanceHealth` added to
`entities/instance`

## Why

Closes #134. Without refresh-on-open the list can be stale; without
pre-flight validation the UI silently navigated to dead instances;
without filtering, the current instance showed up in the list (no-op
switch).

## Test plan

- [ ] Open instance switcher → instances list refreshes (network tab
shows `/api/instances` request)
- [ ] Wait 10 s → each item's agent count / artifact total updates
- [ ] Kill a second instance → it shows `offline` next to that entry
- [ ] Click an offline instance → sonner error toast appears, no
navigation
- [ ] Only one instance running → empty state shows "No other instances
are running"
- [ ] `svelte-check` passes with 0 errors ✅

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Closes #137, #138, #139

Skeleton loading (#137):
- Show animated skeleton placeholder in instance switcher while
  instanceStatuses[id] === undefined (first poll in flight); replaces
  the previous empty-slot behavior

data-test attributes (#138):
- data-test="instance-switcher-trigger" on Popover.Trigger
- data-test="instance-switcher" on Popover.Content
- data-test="instance-switcher-empty" on Command.Empty
- data-test="instance-item" + data-test-id={inst.id} on each Command.Item
- data-test="instance-status" on live status span
- data-test="instance-offline" on offline badge

Forgeplan EvidencePack (#139):
- EVID-038 "instance-status endpoint smoke test" activated (draft → active)
- Linked to PRD-027 + RFC-023 (informs); congruence_level: 3, evidence_type: test
- PRD-027 + RFC-023 frontmatter updated with backlinks

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nce (#140)

## Summary

Follow-ups from issue #134 and PR #136.

- **Skeleton loading** (#137) — while `instanceStatuses[id] ===
undefined` (first poll not yet done), show an animated skeleton
placeholder instead of nothing in the status column of each instance row
- **`data-test` attributes** (#138) — added to every meaningful element
of the instance switcher for e2e test targeting:
  - `data-test="instance-switcher-trigger"` on the trigger button
  - `data-test="instance-switcher"` on the popover content
  - `data-test="instance-switcher-empty"` on the empty state
  - `data-test="instance-item"` + `data-test-id={inst.id}` on each row
  - `data-test="instance-status"` on the live status span
  - `data-test="instance-offline"` on the offline badge
- **Forgeplan EvidencePack** (#139) — EVID-038 activated, linked to
PRD-027 + RFC-023 with `congruence_level: 3`, `evidence_type: test`

Closes #137, #138, #139

## Test plan

- [ ] Open switcher immediately after page load → skeleton visible in
each row while status pending
- [ ] After ~3 s (first poll) → skeleton replaced by agent count or
"offline"
- [ ] `[data-test="instance-item"]` selectable in devtools
- [ ] `svelte-check`: 0 errors ✅

🤖 Generated with [Claude Code](https://claude.com/claude-code)
- Swap Popover.Root + Popover.Trigger + Popover.Portal for a plain
  <button> trigger + shared/ui Dialog (native <dialog showModal()>)
- Dialog always shows Command.Input so the empty-state has a search
  field with a descriptive placeholder; no conditional rendering
- Extract instance list row into entities/instance/ui/InstanceItem.svelte
  (FSD: entity owns its own UI primitive); HealthBar composes it
- Update switcher-btn CSS from :global() to scoped selectors (now a
  plain <button>); remove :global(.switcher-popover) block; update
  switcher-cmd-input to box-style suited for dialog context

Refs: PRD-027

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
## Summary

- Replaces the `Popover` + `Command` combo with a proper `Dialog`
(native `<dialog showModal()>` via `shared/ui/Dialog`) that opens when
clicking the project name trigger
- `Command.Input` is always visible in the dialog — the placeholder
changes to *"No other instances running"* in the empty state so users
know what to do
- Extracts the instance list row into
`entities/instance/ui/InstanceItem.svelte` (FSD: entity layer owns its
own display primitive)
- Migrates switcher trigger CSS from `:global(.switcher-btn)` to scoped
selectors (it's now a plain `<button>`, not `Popover.Trigger`)
- Removes the `:global(.switcher-popover)` block; `Command.Input` gets a
box-style border instead of the previous bottom-border-only style

## Why

Previous Popover felt like a plain floating box with no backdrop or
modal affordance — especially noticeable in the no-instances empty
state. A Dialog gives a proper modal surface, keyboard dismiss (Escape),
backdrop click to close, and focus trap out of the box.

## Test plan

- [ ] Clicking the project name opens a modal dialog with "Switch
instance" title
- [ ] Escape or clicking the backdrop closes the dialog
- [ ] Empty state: Command.Input shows disabled placeholder, empty-state
copy is visible
- [ ] With other instances: search filters list, clicking an instance
triggers pre-flight check → navigate or toast error
- [ ] `data-test` attributes preserved: `instance-switcher-trigger`,
`instance-switcher`, `instance-switcher-empty`, `instance-item`,
`instance-status`, `instance-offline`
- [ ] `svelte-check`: 0 errors, 0 warnings (1072 files)

Refs: PRD-027

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@fedorovvvv
fedorovvvv merged commit d29f8da into main May 9, 2026
3 checks passed
@fedorovvvv
fedorovvvv deleted the release/v0.2.2 branch May 9, 2026 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant